<?php
function smarty_block_mainoptions($params, $content, &$smarty, $repeat) {
	if(!$repeat) {
		$title = "";

		$id = uniqid();
		$style = "";
		if(isset($params['class']) && $params['class'] == 'expand') {
			$style = "style=\"display: none;\"";
		}

		$class = isset($params['class'])?$params['class']:'colapse';

		if(isset($params['title'])) {
			$title = "<h2 class=\"slidingTab\"><a class=\"$class\" href=\"#\" onclick=\"$('#$id').toggle();$(this).toggleClass('expand').toggleClass('colapse');return false;\">".$params['title']."</a></h2>";
		}

		return "<div class=\"mainOptions\">$title<div id=\"$id\" $style>$content</div></div>";
		

		
	}
}